﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICSharpCode.TextEditor.Document;
using System.Xml;
using System.IO;
using System.Reflection;

namespace ImmlPad
{
    class EmbeddedResourceSyntaxModeProvider : ISyntaxModeFileProvider
    {
        private List<SyntaxMode> _SyntaxModes;
        private string _EmbeddedResource;

        public EmbeddedResourceSyntaxModeProvider(string embeddedResource, List<SyntaxMode> syntaxModes)
        {
            _EmbeddedResource = embeddedResource;
            _SyntaxModes = syntaxModes;
        }

        #region ISyntaxModeFileProvider Members

        public XmlTextReader GetSyntaxModeFile(SyntaxMode syntaxMode)
        {
            return new XmlTextReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(_EmbeddedResource));
        }

        public ICollection<SyntaxMode> SyntaxModes
        {
            get { return _SyntaxModes; }
        }

        public void UpdateSyntaxModeList()
        {
            
        }

        #endregion
    }
}
